package org.example;

/**
 * @author TonySong
 * @date 2025/7/30 0030
 * @time 14:06
 */
public class Test1 {
    public static void main(String[] args) throws ClassNotFoundException {
        Class<User> c2 = User.class;
        //1
        Class<?> c1=Class.forName("org.example.User");
        //2
        //3
        User user=new User();
        Class<? extends User> c3 = user.getClass();
        System.out.println(c1.hashCode());
        System.out.println(c2.hashCode());
        System.out.println(c3.hashCode());
        //以上的代码说明了3种方式获取的类的对象是同一个。
        Class<?> c4=Class.forName("org.example.User");
        System.out.println(c4.hashCode());

    }
}
